<template>
  <div class="md-layout-item md-medium-size-100 md-xsmall-size-100 md-size-100">
    <md-card>
      <md-card-content>
        <div class="md-layout">
          <div class="md-layout-item md-size-100 text-right">
            <md-button class="md-raised md-success" @click="search"><md-icon>search</md-icon>查询</md-button>
          </div>

          <edit-item title="申请编号" :mergelen="2">
            <md-input v-model="querycondi.applyCd" :mergelen="2"></md-input>
          </edit-item>
          <edit-item title="申请状态" edittype="S" :mergelen="2">
            <select v-model="querycondi.appStatus">
              <option value="">--请选择--</option>
              <option value="17">申请审批中</option>
              <option value="25">放款审批中</option>
              <option value="26">待放款</option>
              <option value="27">已放款</option>
              <option value="31">已取消</option>
              <option value="18">已拒绝</option>
            </select>
          </edit-item>
          <edit-item title="申请明细状态" edittype="S" :mergelen="2">
            <select v-model="querycondi.appStatusDetail">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <edit-item title="申请人姓名/机构名称" :mergelen="2">
            <md-input v-model="querycondi.customerName"></md-input>
          </edit-item>
          <edit-item title="证件号码/机构代码" :mergelen="2">
            <md-input v-model="querycondi.creditNo"></md-input>
          </edit-item>
          <edit-item title="金融机构" edittype="S" :mergelen="2">
            <select v-model="querycondi.fininstId">
              <option v-for="option in fininstlist" v-bind:value="option.FININSTID" v-bind:key="option.FININSTID">{{ option.FININSTNAME }}</option>
            </select>
          </edit-item>
          <edit-item title="渠道商" edittype="S" :mergelen="2">
            <select v-model="querycondi.branchId">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <edit-item title="经销商名称" :mergelen="2">
            <md-input v-model="querycondi.dealerName"></md-input>
          </edit-item>
          <edit-item title="经销商代理商名称" :mergelen="2">
            <md-input v-model="querycondi.dealerAgentName"></md-input>
          </edit-item>
          <edit-item title="经销商城市" edittype="S" :mergelen="2">
            <select v-model="querycondi.dealerCity">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <edit-item title="销售顾问" :mergelen="2">
            <md-input v-model="querycondi.salConsultabtName"></md-input>
          </edit-item>
          <edit-item title="是否先抵后放" edittype="S" :mergelen="2">
            <select v-model="querycondi.mortagageBeforeLoan">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>

          <edit-item title="城市" :mergelen="2">
            <md-input v-model="querycondi.cityName"></md-input>
          </edit-item>
          <edit-item title="专员" :mergelen="2">
            <md-input v-model="querycondi.dfimName"></md-input>
          </edit-item>
          <edit-item title="融资合同号" :mergelen="2">
            <md-input v-model="querycondi.rzContractNo"></md-input>
          </edit-item>
          <edit-item title="来源名称" :mergelen="2">
            <md-input v-model="querycondi.sourceName"></md-input>
          </edit-item>

          <edit-item title="是否二手车" edittype="S" :mergelen="2">
            <select v-model="querycondi.secondHandFlg">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <edit-item title="开票经销商" :mergelen="2">
            <md-input v-model="querycondi.offerDealer"></md-input>
          </edit-item>
          <edit-item title="GPS安装是否完成" edittype="S" :mergelen="2">
            <select v-model="querycondi.gpsDoneFlg">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <edit-item title="GPS供应商" edittype="S" :mergelen="2">
            <select v-model="querycondi.gpsSupplier">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <edit-item title="网银流水" :mergelen="2">
            <md-input v-model="querycondi.webBankSerialNo"></md-input>
          </edit-item>
          <edit-item title="登记证书编号" :mergelen="2">
            <md-input v-model="querycondi.carLetterNo"></md-input>
          </edit-item>
          <edit-item title="合作机构" edittype="S" :mergelen="2">
            <select v-model="querycondi.coopOrganizationCd">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <edit-item title="提交来源" edittype="S" :mergelen="2">
            <select v-model="querycondi.firstSubmitType">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>

          <edit-item title="签约模式" edittype="S" :mergelen="2">
            <select v-model="querycondi.signType">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <edit-item title="合作金融机构" :mergelen="2">
            <select v-model="querycondi.cofininstCd">
              <option v-for="option in g_mlist('29')" v-bind:value="option.itemvalue" v-bind:key="option.itemvalue">{{ option.itemcontent }}</option>
            </select>
          </edit-item>
          <div class="md-layout-item md-small-size-100 md-size-33"></div>
          <edit-item title="申请日期" :mergelen="2">
            <md-input v-model="querycondi.applydateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.applydateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="放款时间" :mergelen="2">
            <md-input v-model="querycondi.loanDateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.loanDateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="批复时间" :mergelen="2">
            <md-input v-model="querycondi.finalExamDateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.finalExamDateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="拒绝时间" :mergelen="2">
            <md-input v-model="querycondi.refuseDateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.refuseDateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="取消时间" :mergelen="2">
            <md-input v-model="querycondi.cancelDateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.cancelDateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="贷前资料通过时间" :mergelen="2">
            <md-input v-model="querycondi.bfilePassDateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.bfilePassDateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="贷后资料通过时间" :mergelen="2">
            <md-input v-model="querycondi.afilePassDateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.afilePassDateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="贷前客服交接时间" :mergelen="2">
            <md-input v-model="querycondi.btoCsDateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.btoCsDateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="贷后客服交接时间" :mergelen="2">
            <md-input v-model="querycondi.atoCsDateFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.atoCsDateTo" type="date"></md-input>
          </edit-item>
          <edit-item title="保单到期日" :mergelen="2">
            <md-input v-model="querycondi.insDateDueFrom" type="date"></md-input>
            ～
            <md-input v-model="querycondi.finCarChassisNo" type="date"></md-input>
          </edit-item>
          <edit-item title="登记证书交接时间" :mergelen="2">
            <md-input v-model="querycondi.carletterGrantedDateTimeBegin" type="date"></md-input>
            ～
            <md-input v-model="querycondi.carletterGrantedDateTimeEnd" type="date"></md-input>
          </edit-item>
        </div>
        <div class="md-layout-item md-size-100 text-right">
          <md-button class="md-raised md-success" @click="search"><md-icon>cloud_download</md-icon>导出</md-button>
          <md-button class="md-raised md-success" @click="search"><md-icon>cloud_download</md-icon>导出CSV</md-button>
          <md-button class="md-raised md-success" @click="search"><md-icon>search</md-icon>查询</md-button>
        </div>
      </md-card-content>
    </md-card>
  </div>
</template>
<script>
import EditItem from './Unit/EditItem.vue'
export default {
  name: 'query-querycondi-form',
  components: {
    'edit-item': EditItem
  },
  props: {
    querycondi: {}
  },
  data () {
    return {
      fininstlist: [] // 金融机构list
    }
  },
  mounted () {
    window.common.getDealerList('1').then(data => {
      this.dealerlist = data.dealerlist
    })
  },
  methods: {
    search: function () {
      // alert(this.querycondi.customername);
      this.$emit('clickSearch', this.querycondi)
    }
  }
}

</script>
